import Mock from 'mockjs'

const count = 20;

const List = [];

for (let i = 0; i < count; i++) {
  List.push(Mock.mock({
    'id|1': '@increment',
    username: '@first',
    'accountType|1': _.map(consts.ACCOUNT_TYPE, 'value'),
    realName: '@first',
    registerIp: '@ip',
    registerIpAddress: '@city(true)',
    'ipSource|1': _.map(consts.DEVICE_TYPE, 'value'),
    lastLoginIp: '@ip',
    lastLoginIpAddress: '@city(true)',
    lastLoginTime: +Mock.Random.date('T'),
    overlapIp: '@ip',
  }))
}

const ConflictList = [];

for (let i = 0; i < count; i++) {
  ConflictList.push(Mock.mock({
    'id|1': '@increment',
    username: '@first',
    'accountType|1': _.map(consts.ACCOUNT_TYPE, 'value'),
    realName: '@first',
    'mobile|1': ['135****0431', '156****4034', '160****3293'],
    mobileAddress: '@city(true)',
    'source|1': _.map(consts.DEVICE_TYPE, 'value'),
    'uuid|1': [
      '9004e97d086c763d322c620c8165749be869aba3',
      '49224e97d086c763d322c620c8165749be869aba3'
    ],
    'isOverlap|1': true,
  }))
}

const RateList = [];

for (let i = 0; i < count; i++) {
  RateList.push(Mock.mock({
    'id|1': '@increment',
    'platformType|1': _.map(consts.PLATFORM_TYPE, 'value'),
    'gameType|1': _.map(consts.GAME_TYPE, 'value'),
    'betMoney|1-10000000': 10000000,
    'payoutMoney|1-10000000': 10000000,
    'awardRate|1-100': 10000,
  }))
}

const LoginList = []

for (let i = 0; i < count; i++) {
  LoginList.push(Mock.mock({
    'id|1': '@increment',
    'accountType|1': _.map(consts.ACCOUNT_TYPE, 'value'),
    username: '@first',
    realName: '@first',
    lastLoginIp: '@ip',
    lastLoginIpAddress: '@city(true)',
    lastLoginTime: +Mock.Random.date('T'),
    'deviceType|1': _.map(consts.DEVICE_TYPE, 'value'),
  }))
}

export default {
  [api.RISK_IP_OVERLAP_LIST]: () => ({
    code: 1,
    data: {
      total: List.length,
      items: List
    },
  }),

  [api.RISK_DEVICE_CONFLICT_LIST]: () => ({
    code: 1,
    data: {
      total: ConflictList.length,
      items: ConflictList
    },
  }),

  [api.RISK_AWARD_RATE_LIST]: () => ({
    code: 1,
    data: {
      total: RateList.length,
      items: RateList
    },
  }),
  [api.RISK_USER_LOGIN_LIST]: () => ({
    code: 1,
    data: {
      total: LoginList.length,
      items: LoginList
    },
  })
}
